window = global;
window.addEventListener = function(){}

document = {}
document.addEventListener = function(a,b,c){
    b()
}
document.createElement = function(a){
    return {
        firstChild:{
            href:'https://www.python-spider.com/'
        },
    }
}
setTimeout = function(){}

js_code

function get_cookie(){
    return document.cookie
}
